home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH9 / 9-2-1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  3.3 KB  |  114 lines

  1. VERSION 5.00
  2. Begin VB.Form frm9_2_1 
  3.    Caption         =   "Create College List"
  4.    ClientHeight    =   1335
  5.    ClientLeft      =   1125
  6.    ClientTop       =   2040
  7.    ClientWidth     =   5055
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1335
  20.    ScaleWidth      =   5055
  21.    Begin VB.CommandButton cmdDone 
  22.       Caption         =   "Done"
  23.       Height          =   375
  24.       Left            =   3720
  25.       TabIndex        =   7
  26.       Top             =   840
  27.       Width           =   1215
  28.    End
  29.    Begin VB.CommandButton cmdAddCollege 
  30.       Caption         =   "Add College to File"
  31.       Height          =   375
  32.       Left            =   120
  33.       TabIndex        =   6
  34.       Top             =   840
  35.       Width           =   1815
  36.    End
  37.    Begin VB.TextBox txtYear 
  38.       Height          =   285
  39.       Left            =   4320
  40.       TabIndex        =   5
  41.       Top             =   480
  42.       Width           =   615
  43.    End
  44.    Begin VB.TextBox txtState 
  45.       Height          =   285
  46.       Left            =   1680
  47.       TabIndex        =   3
  48.       Top             =   480
  49.       Width           =   375
  50.    End
  51.    Begin VB.TextBox txtCollege 
  52.       Height          =   285
  53.       Left            =   1680
  54.       TabIndex        =   1
  55.       Top             =   120
  56.       Width           =   3255
  57.    End
  58.    Begin VB.Label lblYear 
  59.       Alignment       =   1  'Right Justify
  60.       Caption         =   "Year founded:"
  61.       Height          =   255
  62.       Left            =   3000
  63.       TabIndex        =   4
  64.       Top             =   480
  65.       Width           =   1215
  66.    End
  67.    Begin VB.Label lblState 
  68.       Alignment       =   1  'Right Justify
  69.       Caption         =   "State located:"
  70.       Height          =   255
  71.       Left            =   120
  72.       TabIndex        =   2
  73.       Top             =   480
  74.       Width           =   1455
  75.    End
  76.    Begin VB.Label lblName 
  77.       Alignment       =   1  'Right Justify
  78.       Caption         =   "Name of College:"
  79.       Height          =   255
  80.       Left            =   0
  81.       TabIndex        =   0
  82.       Top             =   120
  83.       Width           =   1575
  84.    End
  85. Attribute VB_Name = "frm9_2_1"
  86. Attribute VB_GlobalNameSpace = False
  87. Attribute VB_Creatable = False
  88. Attribute VB_PredeclaredId = True
  89. Attribute VB_Exposed = False
  90. Dim recordNum As Integer
  91. Private Sub cmdAddCollege_Click()
  92.   'Write a record into the file COLLEGES.TXT
  93.   Dim college As collegeData
  94.   college.nom = txtCollege.Text
  95.   college.state = txtState.Text
  96.   college.yrFounded = Val(txtYear.Text)
  97.   recordNum = recordNum + 1
  98.   Put #1, recordNum, college
  99.   txtCollege.Text = ""
  100.   txtState.Text = ""
  101.   txtYear.Text = ""
  102.   txtCollege.SetFocus
  103. End Sub
  104. Private Sub cmdDone_Click()
  105.   Close #1
  106.   End
  107. End Sub
  108. Private Sub Form_Load()
  109.   'Create COLLEGES.TXT
  110.   Dim college As collegeData
  111.   Open App.Path & "\COLLEGES.TXT" For Random As #1 Len = Len(college)
  112.   recordNum = 0
  113. End Sub
  114.